package com.wd.user;

import androidx.lifecycle.MutableLiveData;

import com.wd.common.userservice.IMemberCommonService;
import com.wd.common.userservice.bean.MemberBean;
import com.wd.common.userservice.bean.TestBean;
import com.wd.user.model.MemberRespository;

/**
 * NA<BR>
 *
 * @author w4425
 * @version [V2.0.0, 2021/3/18]
 * @since V2.0.0
 */
public class MemberCommonServiceImpl implements IMemberCommonService {
    private MutableLiveData<TestBean> liveData;

    @Override
    public MemberBean queryMemberInfo(String key) {
        MemberBean bean = new MemberBean();
        bean.id = key;
        bean.nickName = "zhangsan";
        return bean;
    }

    @Override
    public void queryDataFromNet() {
        MemberRespository respository = new MemberRespository();
        respository.getData(getMemberLiveData());
    }

    @Override
    public MutableLiveData getMemberLiveData() {
        if (liveData == null) {
            liveData = new MutableLiveData<>();
        }
        return liveData;
    }
}
